//logs.js
const util = require('../../utils/util.js')

Page({
  data: {
    couponStatus:'0',
    swiperIndex:'0'
  },
  onLoad: function () {
    this.setData({
      logs: (wx.getStorageSync('logs') || []).map(log => {
        return util.formatTime(new Date(log))
      })
    })
  },
  //选项卡点击效果
  onTap: function (e) {
    if (this.data.couponStatus === e.target.dataset.current) {
      return false;
    } else {
      this.setData({
        couponStatus: e.target.dataset.current,
        swiperIndex: e.target.dataset.current
      })
    }
    
  },
  //选项卡列表滑动效果
  bindChange:function(e){
    console.log(e)
    this.setData({
      couponStatus: e.detail.current
    })
  }
})
